package weng.testcode;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

import org.netbeans.jemmy.ClassReference;
import org.netbeans.jemmy.operators.JFrameOperator;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;

public class NewTest {
  @Test
  public void f() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException {
//	  TestJavaWS tjws=new TestJavaWS();
//	  try {
//		Runtime.getRuntime().exec("c:\\DeploymentManage.exe");
//	} catch (IOException e) {
//		// TODO Auto-generated catch block
//		e.printStackTrace();
//	}
	
	  System.out.println("**********************1");
	
	ClassReference application;	
	JFrameOperator mainFrame = new JFrameOperator();
	try {
		Thread.sleep(5000);
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	System.out.println("**********************2");
		application = new ClassReference("itat.zttc.emp.viewer.RunFrame");
		application.startApplication();
		System.out.println("**********************3");
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("**********************4");
	
		System.out.println("**********************5");
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("**********************6");
  }
  @BeforeTest
  public void beforeTest() {
  }

  @AfterTest
  public void afterTest() {
  }
  public static void main(String[] args){
	  System.out.println("**********************1");
	  
		try {
			Thread.sleep(4000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	  
	  TestJavaWS tws=new TestJavaWS();
		JFrameOperator mainFrame = new JFrameOperator();
	  
	  
	  
  }
//	  try {
////		Runtime.getRuntime().exec("c:\\DeploymentManage.exe");
////		Runtime.getRuntime().exec("C:\\Users\\wengqiy\\Desktop\\DeploymentManage.exe");
////		Runtime.getRuntime().exec("c:\\iexplore.exe");
////		
//		Runtime.getRuntime().exec("javaws https://qa2.barra.com/bpm/bpm.jnlp");
//		
//	} catch (IOException e) {
//		// TODO Auto-generated catch block
//		e.printStackTrace();
//	}
//	
//	
//	try {
//		Thread.sleep(20000);
//	} catch (InterruptedException e) {
//		// TODO Auto-generated catch block
//		e.printStackTrace();
//	}
//  }
}
